<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.2.1.min.js"></script>
    <script>
        $(function () {
            $('#btn').on('click',function () {
                console.log($('p').html())
            })
        })
    </script>
</head>
<body>
<p>
    我说一个p
    <a href="www.baidu.com">我是百度</a>
</p>
<button id="btn">click</button>
</body>
</html>